<?php

/**
 * myDoctorSearch form.
 *
 * @package    docplus.co.za
 * @subpackage form
 * @author     Fox Matuku
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class myDoctorSearchForm extends sfForm {

	public function configure() {
		$this->widgetSchema['speciality_id'] = new sfWidgetFormDoctrineChoice(array('model' => 'Speciality', 'add_empty' => 'Search by speciality'), array('class' => 'select-box'));
		//$this->widgetSchema['medical_insurance_id'] = new sfWidgetFormDoctrineChoice(array('model' => 'MedicalInsurance', 'add_empty' => 'Search by medical insurance'), array('class' => 'select-box'));
		$this->widgetSchema['region_id'] = new sfWidgetFormDoctrineChoice(array('model' => 'Region', 'add_empty' => 'Search by region'), array('class' => 'select-box'));
		$this->widgetSchema['city_id'] = new sfWidgetFormDoctrineChoice(array('model' => 'City', 'add_empty' => 'Search by city'), array('class' => 'select-box'));
		//$this->widgetSchema['appointment_reason_id'] = new sfWidgetFormDoctrineChoice(array('model' => 'AppointmentReason', 'add_empty' => 'Search by appointment reason'), array('class' => 'select-box'));
		$this->widgetSchema['gender'] = new sfWidgetFormChoice(array('choices' => array('' => 'Search by gender', 'Male' => 'Male', 'Female' => 'Female')), array('class' => 'select-box'));
		$this->widgetSchema['name'] = new sfWidgetFormInputText(array());

		$this->validatorSchema['speciality_id'] = new sfValidatorDoctrineChoice(array('required' => false, 'model' => 'Speciality'));
		//$this->validatorSchema['medical_insurance_id'] = new sfValidatorDoctrineChoice(array('required' => false, 'model' => 'MedicalInsurance'));
		$this->validatorSchema['region_id'] = new sfValidatorDoctrineChoice(array('required' => false, 'model' => 'Region'));
		$this->validatorSchema['city_id'] = new sfValidatorDoctrineChoice(array('required' => false, 'model' => 'City'));
		//$this->validatorSchema['appointment_reason_id'] = new sfValidatorDoctrineChoice(array('required' => false, 'model' => 'AppointmentReason'));
		$this->validatorSchema['gender'] = new sfValidatorChoice(array('required' => false, 'choices' => array(0 => '', 1 => 'Male', 2 => 'Female')));
		$this->validatorSchema['name'] = new sfValidatorString(array('required' => false, 'max_length' => 255), array('max_length' => 'Only 128 characters are allowed in this field.'));

		$this->widgetSchema->setNameFormat('doctor[%s]');
	}

}
